Move endian detection back to runtime to benefit universal binaries on Mac.
authorrobertl <robertl>
Thu, 15 May 2008 14:19:14 +0000 (14:19 +0000)
committerrobertl <robertl>
Thu, 15 May 2008 14:19:14 +0000 (14:19 +0000)
util.c

diff --git a/util.c b/util.c
index 8ded3ea2a3df63a75ffdb185a6e5da93792166b7..41286af81e57923934dc299ea5a797b82e0bb4eb 100644 (file)
--- a/util.c
+++ b/util.c
 #include <stdarg.h>
 #include <time.h>
 
+// First test Apple's clever macro that's really a runtime test so
+// that our universal binaries work right.
+#if defined __BIG_ENDIAN__
+#define i_am_little_endian !__BIG_ENDIAN__
+#else
 #if defined WORDS_BIGENDIAN
 # define i_am_little_endian 0
 #else
 # define i_am_little_endian 1
 #endif
+#endif
 
 #ifdef DEBUG_MEM
 #define DEBUG_FILENAME "/tmp/gpsbabel.debug"